import request from '@/utils/request'

export const GoodsTypeApi = {

  /**
   *  分页
   * @returns
   */
  getPage: (data) => {
    return request({
      url: '/manage/food/goodsType/getPage',
      data,
      method: 'post'
    })
  },

  /**
   *  获取所有类型
   * @returns
   */
  getAllList: () => {
    return request({
      url: '/manage/food/goodsType/getAllList',
      method: 'get'
    })
  },

  /**
   *  删除
   * @returns
   */
  delete: (goodsTypeId) => {
    return request({
      url: '/manage/food/goodsType/delete',
      params:{goodsTypeId},
      method: 'get'
    })
  },

  /**
   *  更新
   * @returns
   */
  update: (data) => {
    return request({
      url: '/manage/food/goodsType/update',
      data,
      method: 'post'
    })
  },

  /**
   *  插入
   * @returns
   */
  insert: (data) => {
    return request({
      url: '/manage/food/goodsType/insert',
      data,
      method: 'post'
    })
  }

}
